/**
 * Created by leo on 2018/11/9.
 */
import {Toast} from "antd-mobile"
let MToast ={};

if(browser.isInApp){
	MToast={
		info:(msg)=>{
			Func.callHander(bridge,"showToast",{
				type:0,
				msg:msg
			});
		},
		fail:(msg)=>{
			Func.callHander(bridge,"showToast",{
				type:2,
				msg:msg
			});
		},
		success:(msg)=>{
			Func.callHander(bridge,"showToast",{
				type:1,
				msg:msg
			});
		}
	}
}
else{
	MToast={
		info:(content, duration, onClose, mask)=>{
			Toast.info(content, duration, onClose, mask);
		},
		fail:(content, duration, onClose, mask)=>{
			Toast.fail(content, duration, onClose, mask);
		},
		success:(content, duration, onClose, mask)=>{
			Toast.success(content, duration, onClose, mask);
		}
	}
}
export default MToast;
